package com.lx.design.demo.guava;

import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * @author lx
 * @date 2021/2/24 11:01
 */
@Slf4j
public class JoinTester {

    public static void main(String[] args) {
        join();
    }

    private static void join() {
        //返回一个与该联接器具有相同行为的联接器，但会自动跳过任何联接器 提供了null元素
        Joiner joiner = Joiner.on(',').skipNulls();
        List<Integer> list = Lists.newArrayList(1, 2, 3,null, 5);
        String join = joiner.join(list);
        log.info(join);
    }

    private void map(){

    }
}
